package com.steam.xbcc.fallback;

import com.steam.xbcc.feign.MediaFileService;
import com.steam.xbcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFileServiceFallbackFactory implements FallbackFactory<MediaFileService> {

    @Override
    public MediaFileService create(Throwable throwable) {
        return new MediaFileService() {
            @Override
            public JSONResult getMediaFileByCourseId(Long courseId) {
                return JSONResult.error();
            }
        };
    }
}
